from selenium import  webdriver
driver= webdriver.Chrome()
driver.get('http://music.baidu.com/top/new')
#查找50首歌曲标签
ele=driver.find_elements_by_css_selector("#songListWrapper ul li")

for eles in ele:
    #查找歌曲箭头向上的歌曲箭头
    upTags = eles.find_elements_by_class_name("up")
    if upTags:
         # 歌曲名
        gtille = eles.find_element_by_css_selector('span[class="song-title "] a').text

        #演唱者名
        authorsStr = eles.find_element_by_class_name("author_list").text

        print('{:<10s}:{}'.format(gtille, authorsStr))

driver.quit()
